from noise import *
from filters import *
from segmentation import *
import random

# Imagenes en escala de grises
gray()   
clf()

img = nibabel.load('../../t1_acpc.nii.gz')
img = img.get_data()

z = 50

# Parte 3

#img_segmented = segmentation(img, z)
#imshow(img_segmented[:, :, z])
#show()

min = random.uniform(0.1, 0.5)
max = random.uniform(0.5, 1.0)

max_it = 30

# Parte 2

for i in xrange(max_it):    
    sigma = random.uniform(0.1, 3.5)
    print sigma
    img_with_noise = gaussianNoise(img, min, max, sigma, z)    
    img_segmented = segmentation(img_with_noise, z)
    
# Parte 3

#for i in xrange(max_it):    
    #sigma = random.uniform(0.3, 3.0)
    #print sigma
    #img_gaussian = gaussianFilter(img, sigma, z)    
    #img_segmented = segmentation(img_gaussian, z)
